
var common;
var jxd_data;
function setCommon(data){
	common=data;
};
//获取登录信息
yanhx.addCommon("ready",function(){
	$.java({
		action:'common.getLoginData',
		param:{str_array:['com_id','zhi_biao','kai_biao']},
		callback:function(data){
			for(var k in data){
				var val=data[k];
				yanhx.exec("mutilHandle.save",{
					key:k,
					val:val
				});
			}
		}
	});
});
function setData(data){
	jxd_data=data;
	for(var k in data){
		var val=data[k];
		$("#"+k).fillSelect(val);
		yanhx.exec("mutilHandle.save",{
			key:k,
			val:val
		});
	}
}
//获取文本及和数据字典
yanhx.addCommon("load",function(){
	$.java({
		action:'common.text',
		param:{str_array:['area_single','level_tree']},
		callback:setCommon
	});
	$.java({
		action:'common.data',
		param:{str_array:['get_type','type','pay_type','state','level_type']},
		callback:setData
	});
});


yanhx.addFunc("reLoad",function(){
	location.href=location.href;
});
yanhx.addFunc("savePro",function(){
	//获取工程基本信息
	var pro=$("#pro_base").getBean();
	//获取公司参与及其他信息
	var com=$("#pro_extend").getBean();
	var bean={
		project:pro,
		cust:com.cust,
		pro_member:com.pro_member,
		pro_level:com.pro_level
	};
	delete com.cust;
	delete com.pro_member;
	delete com.pro_level;
	bean.other=com;
	$.java({
		action:"project.savePro",
		param:bean,
		callback:function(data){
			$.alert(data.mes,function(){
				
			});
		}
	});
});
